package com.example.xuanke.mapper;

import com.example.xuanke.pojo.Xuanke;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface XuankeMapper {

    @Select("select * from xuanke")
    List<Xuanke> getAll();

    @Insert("insert into xuanke (stuname,stuid,cid,createtime,score) values(#{stuname},#{stuid},#{cid},#{createtime},#{score})")
    void add(Xuanke xuanke);

    @Update("update xuanke set stuname=#{stuname},stuid=#{stuid},cid=#{cid},createtime=#{createtime},score=#{score} where id=#{id}")
    void update(Xuanke xuanke);

    @Delete("delete from xuanke where id=#{id}")
    void delete(Integer id);
}
